package com.group3.hospital.service.impl;

import com.group3.hospital.bean.Appointment;
import com.group3.hospital.bean.Doctor;
import com.group3.hospital.bean.Subject;
import com.group3.hospital.mapper.AppointmentMapper;
import com.group3.hospital.service.AppointmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 尚硅谷
 * @create 2021/12/30
 */
@Service
public class AppointmentServiceImpl implements AppointmentService {
    @Autowired
    private AppointmentMapper appointmentMapper;


    @Override
    public List<Appointment> queryAll() throws Exception {
        return appointmentMapper.queryAll();
    }

    @Override
    public Integer queryCount() throws Exception {
        return appointmentMapper.queryCount();
    }

    @Override
    public List<Appointment> queryByPage(Integer pageUse) throws Exception {
        return appointmentMapper.queryByPage(pageUse);
    }

    @Override
    public List<Subject> queryAllSubject() throws Exception {
        return appointmentMapper.queryAllSubject();
    }

    @Override
    public void addAppointment(Appointment appointment) throws Exception {
        appointmentMapper.addAppointment(appointment);
    }

    @Override
    public Doctor queryDoctor(String name) throws Exception {
        return appointmentMapper.queryDoctor(name);
    }
}
